package com.github.jspxnet.worktask.model.enums;

import com.github.jspxnet.enums.EnumType;


/**
 * Created by jspx.net
 *
 * author: chenYuan
 * date: 2020/9/8 22:32
 * description: 步骤节点类型
 **/
public enum FlowNodeEnumType implements EnumType {

    //自动委托modifyAutoCommissionRules cancelAutoCommissionRules、抄送copyWorkitem、签收管理 signForWorkitem

    //结束节点
    END(99, "结束节点"),

    //分支节点
    GATEWAY(3, "网关节点"),

    //人工敢于节点,判断是否满足条件到下一节点或者驳回
    TASK(2, "任务节点"),

    START(1, "开始节点");

    private final int value;
    private final String name;

    FlowNodeEnumType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    static public FlowNodeEnumType find(int value) {
        for (FlowNodeEnumType c : FlowNodeEnumType.values()) {
            if (c.value == value) {
                return c;
            }
        }
        return FlowNodeEnumType.START;
    }

    @Override
    public int getValue() {
        return this.value;
    }

    @Override
    public String getName() {
        return this.name;
    }

}
